<template>
  <div class="app-container">
    <div class="table-page-search-wrapper">
      <el-form :inline="true" label-width="100px">
        <el-row :gutter="18">
          <el-col :md="8" :sm="24">
            <el-form-item label="物料编号">
              <el-input
                v-model="queryParam.goodsCode"
                placeholder="请输入物料编号"
                @keyup.enter.native="onSearch"
              />
            </el-form-item>
          </el-col>
          <el-col :md="8" :sm="24">
            <el-form-item label="物料名称">
              <el-input
                v-model="queryParam.goodsName"
                placeholder="请输入物料名称"
                @keyup.enter.native="onSearch"
              />
            </el-form-item>
          </el-col>
          <el-col :md="8" :sm="24">
            <span class="table-page-search-submitButtons">
              <el-button
                v-waves
                type="primary"
                icon="el-icon-search"
                @click="onSearch"
              >
                查询
              </el-button>
              <el-button type="info" icon="el-icon-refresh" @click="reset">
                重置
              </el-button>
            </span>
          </el-col>
        </el-row>
      </el-form>
    </div>

    <div class="table-operator" />

    <el-table
      v-loading="loadingData"
      :data="list"
      element-loading-text="Loading"
      fit
      highlight-current-row
      row-key="id"
      @sort-change="appendSorterParam"
    >
      <el-table-column align="center" label="序号" type="index" />
      <el-table-column align="center" label="物料编号">
        <template slot-scope="scope">
          <span>
            {{ scope.row.goodsCode }}
          </span>
        </template>
      </el-table-column>
      <el-table-column align="center" label="物料名称">
        <template slot-scope="scope">
          <span>
            {{ scope.row.goodsName }}
          </span>
        </template>
      </el-table-column>
      <el-table-column align="center" label="规格">
        <template slot-scope="scope">
          <span>
            {{ scope.row.goodsSpecifications }}
          </span>
        </template>
      </el-table-column>
      <el-table-column align="center" label="库位">
        <template slot-scope="scope">
          <span>
            {{ scope.row.lable }}
          </span>
        </template>
      </el-table-column>
      <el-table-column align="center" label="现存数量">
        <template slot-scope="scope">
          <span>
            {{ scope.row.quantity }}
          </span>
        </template>
      </el-table-column>
    </el-table>
    <pagination
      v-show="pagination.total > 0"
      :total="pagination.total"
      :page.sync="pagination.current"
      :limit.sync="pagination.pageSize"
      :style="{ textAlign: 'right' }"
      @pagination="handlePaginationChanged"
    />
  </div>
</template>

<script>
import list from '@/components/diboot/mixins/list'
import waves from '@/directive/waves'
export default {
  name: 'LatticeGoodsList',
  directives: { waves },
  components: {},
  mixins: [list],
  data() {
    return {
      baseApi: '/warehouse/latticeGoods',
      getListFromMixin: true,
      attachMoreList: [
        {
          target: 'Goods',
          label: 'goodsName',
          value: 'id'
        }
      ]
    }
  }
}
</script>
<style lang="scss" scoped></style>
